/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package wbd_au.objects_mappings;

import java.sql.Date;
import java.sql.SQLData;
import java.sql.SQLException;
import java.sql.SQLInput;
import java.sql.SQLOutput;

/**
 *
 * @author Gospo
 */
public class SluzbaWartownicza implements SQLData {
    int idWarta;
    Date czasOd;
    Date czasDo;
    int idRegion;
    String sqlType;

    @Override
    public String getSQLTypeName() {
        return sqlType;
    }

    @Override
    public void readSQL(SQLInput stream, String typeName) throws SQLException {
        sqlType = typeName;

        idWarta = stream.readInt();
        czasOd = stream.readDate();
        czasDo = stream.readDate();
        idRegion = stream.readInt();
    }

    @Override
    public void writeSQL(SQLOutput stream) throws SQLException {
       stream.writeInt(idWarta);
       stream.writeDate(czasOd);
       stream.writeDate(czasDo);
       stream.writeInt(idRegion);
   }
}
